package file_demo1;

import java.io.File;
import java.nio.file.Files;
import java.util.Arrays;

public class demo1 {
    public static void main(String[] args) {
        File f1 = new File("C:\\Users\\xbh00\\Desktop\\biji.txt");
        //是不是文件夹
        System.out.println(f1.isDirectory());
        System.out.println(f1.isFile());
        System.out.println(f1.exists());

        //遍历盘符
        File[] f = File.listRoots();
        System.out.println(Arrays.toString(f));
        //遍历文件夹
        
        File f2 = new File("D:\\my_game");
        String[] s = f2.list();
        for (String string : s) {
            System.out.println(string);
        }
    }
}
